package book;
public class BookList{
    //对多放十本
    private Book[] books = new Book[3];
    private int usedSize ;  //实时记录 目前有几本书

    public BookList() {
        books[0] = new Book("西游记","吴承恩",10,"小说");
        books[1] = new Book("三国演义","施耐庵",11,"小说");
        books[2] = new Book("红楼梦","曹雪芹",12,"小说");
        usedSize = 3;
    }

    //拿出pos处的书
    public Book getBook(int pos){
        return books[pos];
    }

    // 给pos下标放一本书
    public void setBook(int pos, Book book){
        books[pos] = book;
    }

    //获取实时书本数,用于修改
    public int setUesSize(int size){
        return (usedSize = size);
    }
    public int getUesSize(){
        return this.usedSize;
    }

}